package com.zyz.N_反射机制.基本应用.获取运行时类的完整结构;

/**
 * @author: vick
 * @Date: 2025/4/14
 * @Description:
 * @version: 1.0
 */

public class User2 extends Father2 {
    private String name;
    public int age;

    public User2() {
    }

    public User2(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void eat(int a, int b) {
        System.out.println("eat");
    }

    private void sleep(int a, int b) throws IllegalArgumentException{
        System.out.println("sleep");
    }

    @Override
    public String toString() {
        return "User2{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
